/**
 * 
 */
package com.tx.test;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JOptionPane;
/**
 * 
 * @author wanghy
 * @since 2013-9-17
 * 
 */
public class Hello {

	private static List<String> list = new ArrayList<String>();
	private static StringBuffer sb = new StringBuffer("File:\n");
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		File file = new File("d:/");
		String[] strs = file.list();
		for (String str : strs) {
			if (str.matches("^[0-9]*$")) {
				getFile(file.getAbsolutePath() + "//" +str);
			}
		}
		
        JOptionPane.showMessageDialog(null, sb);
	}
	
	public static void getFile(String pathname) {
		File file = new File(pathname);
		if (file.isFile()) {
			list.add(file.getAbsolutePath());
			sb.append(file.getAbsolutePath()+"\n");
		} else {
			for (File f : file.listFiles()) {
				getFile(f.getAbsolutePath());
			}
		}
		
	}

}
